﻿using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;

namespace WCS.Infrastructure.EFCore;

public partial class wcsDbContext : DbContext
{
    public wcsDbContext()
    {
    }

    public wcsDbContext(DbContextOptions<wcsDbContext> options)
        : base(options)
    {
    }

    public virtual DbSet<AccountTransaction> AccountTransactions { get; set; }

    public virtual DbSet<ActionLog> ActionLogs { get; set; }

    public virtual DbSet<CouponConsumptionRecord> CouponConsumptionRecords { get; set; }

    public virtual DbSet<CouponInstance> CouponInstances { get; set; }

    public virtual DbSet<CouponPackage> CouponPackages { get; set; }

    public virtual DbSet<CouponPackageItem> CouponPackageItems { get; set; }

    public virtual DbSet<CouponPackageReceiveRecord> CouponPackageReceiveRecords { get; set; }

    public virtual DbSet<CouponTemplate> CouponTemplates { get; set; }

    public virtual DbSet<DividedAgreement> DividedAgreements { get; set; }

    public virtual DbSet<DividedAgreementDetail> DividedAgreementDetails { get; set; }

    public virtual DbSet<DividedRecord> DividedRecords { get; set; }

    public virtual DbSet<DividedRecordDetail> DividedRecordDetails { get; set; }

    public virtual DbSet<EpaylinksSplitRecord> EpaylinksSplitRecords { get; set; }

    public virtual DbSet<ErrorLog> ErrorLogs { get; set; }

    public virtual DbSet<LinePunchRecord> LinePunchRecords { get; set; }

    public virtual DbSet<LoginLog> LoginLogs { get; set; }

    public virtual DbSet<LotteryActivity> LotteryActivities { get; set; }

    public virtual DbSet<LotteryClaimRecord> LotteryClaimRecords { get; set; }

    public virtual DbSet<LotteryPrize> LotteryPrizes { get; set; }

    public virtual DbSet<Merchant> Merchants { get; set; }

    public virtual DbSet<Order> Orders { get; set; }

    public virtual DbSet<OrderRefundRecord> OrderRefundRecords { get; set; }

    public virtual DbSet<PaymentCode> PaymentCodes { get; set; }

    public virtual DbSet<PaymentDevice> PaymentDevices { get; set; }

    public virtual DbSet<PaymentPlatform> PaymentPlatforms { get; set; }

    public virtual DbSet<RateConfig> RateConfigs { get; set; }

    public virtual DbSet<ReportStatistic> ReportStatistics { get; set; }

    public virtual DbSet<SettlementRecord> SettlementRecords { get; set; }

    public virtual DbSet<Store> Stores { get; set; }

    public virtual DbSet<SysPermission> SysPermissions { get; set; }

    public virtual DbSet<SysRole> SysRoles { get; set; }

    public virtual DbSet<SysRolePermission> SysRolePermissions { get; set; }

    public virtual DbSet<SysUser> SysUsers { get; set; }

    public virtual DbSet<SysUserMiniProgram> SysUserMiniPrograms { get; set; }

    public virtual DbSet<SysUserRole> SysUserRoles { get; set; }

    public virtual DbSet<WithdrawalAccount> WithdrawalAccounts { get; set; }

    public virtual DbSet<WithdrawalRecord> WithdrawalRecords { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
    //=> optionsBuilder.UseNpgsql("Host=localhost;Database=wcs;Username=postgres;Password=csp1314520");
    //=> optionsBuilder.UseNpgsql("Host=118.196.30.7;Port=5432;Database=wcs_simulation;Username=wcs_simulation;Password=wYh42EtKAPfLCMWd");
    => optionsBuilder.UseNpgsql("Host=118.196.30.7;Port=5432;Database=wcs;Username=postgres;Password=TmwcjbAc3tJYyY8n");
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<AccountTransaction>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("AccountTransaction_pkey");

            entity.ToTable("AccountTransaction", tb => tb.HasComment("账户交易记录表"));

            entity.Property(e => e.Id).HasComment("账户交易记录ID");
            entity.Property(e => e.Amount)
                .HasDefaultValue(0L)
                .HasComment("变动金额（正数=增加，负数=减少）");
            entity.Property(e => e.BalanceAfter)
                .HasDefaultValue(0L)
                .HasComment("变动后余额");
            entity.Property(e => e.BalanceType).HasComment("变动的余额类型(1=可用余额,2=冻结余额,3=可提现余额,4=未结算余额,5=待分账余额)");
            entity.Property(e => e.DividedRecordDetailId).HasComment("分账记录详情ID");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.OrderId).HasComment("订单ID");
            entity.Property(e => e.PaymentPlatformId).HasComment("支付平台ID");
            entity.Property(e => e.Remark).HasComment("交易备注（如：退款冻结，结算T+1）");
            entity.Property(e => e.TransactionNo).HasComment("账户交易编号");
            entity.Property(e => e.TransactionTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("交易时间");
            entity.Property(e => e.TransactionType).HasComment("账户交易记录类型：1=分账收入,2=订单退款,3=余额提现,4=结算转入可提现,5=手动转账,6=优惠券互推,10=订单手续费,11=提现手续费,12=优惠券服务费");
            entity.Property(e => e.UserId).HasComment("关联用户ID");
            entity.Property(e => e.WithdrawalRecordId).HasComment("提现记录ID");
        });

        modelBuilder.Entity<ActionLog>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("ActionLog_pkey");

            entity.ToTable("ActionLog", tb => tb.HasComment("行为日志表"));

            entity.Property(e => e.Id).HasComment("行为日志ID");
            entity.Property(e => e.Action).HasComment("行为");
            entity.Property(e => e.ApiUrl).HasComment("本次请求的接口地址");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.Ip).HasComment("请求IP");
            entity.Property(e => e.Params).HasComment("请求参数");
            entity.Property(e => e.Result).HasComment("结果");
            entity.Property(e => e.ResultMessage).HasComment("结果信息");
            entity.Property(e => e.Type).HasComment("类型");
            entity.Property(e => e.UserId).HasComment("用户ID");
            entity.Property(e => e.Version).HasComment("记录版本");
        });

        modelBuilder.Entity<CouponConsumptionRecord>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("CouponConsumptionRecord_pkey");

            entity.ToTable("CouponConsumptionRecord", tb => tb.HasComment("优惠券核销记录表"));

            entity.Property(e => e.Id).HasComment("核销记录ID");
            entity.Property(e => e.CancelReason).HasComment("撤销原因（如“用户退款”“核销错误”等）");
            entity.Property(e => e.CancelTime).HasComment("撤销时间（若撤销，记录撤销的时间）");
            entity.Property(e => e.ConsumptionCodeId).HasComment("核销收款码ID");
            entity.Property(e => e.ConsumptionDevice).HasComment("核销设备信息");
            entity.Property(e => e.ConsumptionIp).HasComment("核销IP地址");
            entity.Property(e => e.ConsumptionTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("核销时间");
            entity.Property(e => e.ConsumptionType).HasComment("核销方式：1=线下POS扫码核销，2=线上支付自动核销，3=小程序手动选择核销，4=API接口核销，5=客服手动核销，6=系统自动核销（满足条件时）");
            entity.Property(e => e.CouponInstanceId).HasComment("关联优惠券实例ID");
            entity.Property(e => e.IsCanceled)
                .HasDefaultValue(false)
                .HasComment("是否已撤销（true=核销后因退款等原因撤销，false=正常核销）");
            entity.Property(e => e.OrderId).HasComment("关联订单ID");
            entity.Property(e => e.UserId).HasComment("用户ID");
        });

        modelBuilder.Entity<CouponInstance>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("CouponInstance_pkey");

            entity.ToTable("CouponInstance", tb => tb.HasComment("优惠券实例表"));

            entity.Property(e => e.Id).HasComment("优惠券实例ID");
            entity.Property(e => e.ActivationExpirationTime).HasComment("激活过期时间");
            entity.Property(e => e.ActivityId).HasComment("抽奖活动ID");
            entity.Property(e => e.AvailableEndTime).HasComment("可使用结束时间：当有效期为固定范围（ValidityType=1）时，取模板固定有效期结束时间；当有效期为相对时长（ValidityType=2）时，取 AvailableStartTime + 模板有效期时长（小时）。");
            entity.Property(e => e.AvailableStartTime).HasComment("可使用开始时间：由模板的生效延迟类型（EffectiveDelayType）与有效期类型（ValidityType）组合计算；当有效期为固定范围（ValidityType=1）时，取 Max(延迟生效时间, 模板固定有效期开始时间)；当有效期为相对时长（ValidityType=2）时，取延迟生效后的时间点作为开始时间。");
            entity.Property(e => e.CodeId).HasComment("所属收款码ID");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发控制标记");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.InstanceCode).HasComment("优惠券实例编号");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改人ID");
            entity.Property(e => e.MerchantId).HasComment("所属商户ID");
            entity.Property(e => e.RecommendMerchantId).HasComment("推荐商户ID");
            entity.Property(e => e.Remarks).HasComment("备注");
            entity.Property(e => e.Status).HasComment("状态：0=未激活，1=未使用，2=已使用，3=已过期，4=已冻结");
            entity.Property(e => e.StoreId).HasComment("所属门店ID");
            entity.Property(e => e.TemplateId).HasComment("关联模板ID");
            entity.Property(e => e.UnionId).HasComment("用户在同一微信开放平台账号下所有应用（包括小程序、公众号等）的全局唯一标识");
            entity.Property(e => e.UserId).HasComment("领取用户ID");
        });

        modelBuilder.Entity<CouponPackage>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("CouponPackage_pkey");

            entity.ToTable("CouponPackage", tb => tb.HasComment("优惠券包表"));

            entity.Property(e => e.Id).HasComment("优惠券包ID");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建人ID");
            entity.Property(e => e.DeleterId).HasComment("删除者ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.Description).HasComment("优惠券包描述");
            entity.Property(e => e.EnableStatus).HasComment("启用状态");
            entity.Property(e => e.EndTime).HasComment("券包失效时间");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IsDeleted).HasComment("是否删除");
            entity.Property(e => e.IssueCount)
                .HasDefaultValue(0)
                .HasComment("总领取次数");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改人ID");
            entity.Property(e => e.MerchantId).HasComment("归属商家ID（平台）");
            entity.Property(e => e.Name).HasComment("优惠券包名称");
            entity.Property(e => e.PackageCode).HasComment("优惠券包编号");
            entity.Property(e => e.QrcodeUrl).HasComment("优惠券包二维码图片地址");
            entity.Property(e => e.StartTime).HasComment("券包生效时间");
            entity.Property(e => e.Status)
                .HasDefaultValue(1)
                .HasComment("券包状态：1=草稿（未发布），2=已发布（可领取），3=已停用（停止领取）");
            entity.Property(e => e.UsedCount)
                .HasDefaultValue(0)
                .HasComment("已使用次数");
        });

        modelBuilder.Entity<CouponPackageItem>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("CouponPackageItem_pkey");

            entity.ToTable("CouponPackageItem", tb => tb.HasComment("优惠券包关联表"));

            entity.Property(e => e.Id).HasComment("优惠券包关联ID");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.PackageId).HasComment("关联优惠券包ID");
            entity.Property(e => e.Quantity)
                .HasDefaultValue(1)
                .HasComment("每个用户可领取的数量（默认1）");
            entity.Property(e => e.Sort)
                .HasDefaultValue(0)
                .HasComment("排序号（券包内优惠券的展示顺序，数字越小越靠前）");
            entity.Property(e => e.TemplateId).HasComment("关联优惠券模板ID");
        });

        modelBuilder.Entity<CouponPackageReceiveRecord>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("CouponPackageReceiveRecord_pkey");

            entity.ToTable("CouponPackageReceiveRecord", tb => tb.HasComment("优惠券包领取记录表"));

            entity.Property(e => e.Id).HasComment("记录ID");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.DeviceInfo).HasComment("领取设备信息（如手机型号）");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.Ipaddress).HasComment("领取IP地址");
            entity.Property(e => e.PackageId).HasComment("关联优惠券包ID");
            entity.Property(e => e.ReceiveChannel)
                .HasDefaultValue(1)
                .HasComment("领取渠道：1=线下扫码，2=线上推荐（小程序），3=活动页面");
            entity.Property(e => e.ReceiveCode).HasComment("领取凭证（如扫码的凭证码）");
            entity.Property(e => e.UserId).HasComment("领取用户ID");
        });

        modelBuilder.Entity<CouponTemplate>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("CouponTemplate_pkey");

            entity.ToTable("CouponTemplate", tb => tb.HasComment("优惠券模板表"));

            entity.Property(e => e.Id).HasComment("优惠券模板ID");
            entity.Property(e => e.CodeId).HasComment("所属收款码ID");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发控制标记");
            entity.Property(e => e.CouponType).HasComment("优惠券类型：1=减免券，2=折扣券，3=礼品券");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建人ID");
            entity.Property(e => e.DeleterId).HasComment("删除人ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.Discount)
                .HasDefaultValueSql("0")
                .HasComment("优惠折扣");
            entity.Property(e => e.DiscountAmount)
                .HasDefaultValue(0L)
                .HasComment("优惠金额");
            entity.Property(e => e.EffectiveDelayType)
                .HasDefaultValue(0)
                .HasComment("生效延迟类型：0=领取后立即生效，1=次日0点生效，2=领取后N小时生效");
            entity.Property(e => e.EffectiveDelayValue).HasComment("生效延迟值（当EffectiveDelayType=2时必填，单位：小时）");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(1)
                .HasComment("模板启用状态：0=禁用,1=启用");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IsDeleted)
                .HasDefaultValue(false)
                .HasComment("是否删除");
            entity.Property(e => e.IsPush).HasComment("是否参与推送");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改人ID");
            entity.Property(e => e.MaxIssuePerUser)
                .HasDefaultValue(1)
                .HasComment("每人最多领取数量");
            entity.Property(e => e.MerchantId).HasComment("所属商户ID");
            entity.Property(e => e.Name).HasComment("优惠券名称");
            entity.Property(e => e.PlatformServiceFeeRate)
                .HasDefaultValueSql("0")
                .HasComment("平台服务费率（3%-5%）");
            entity.Property(e => e.PosterUrl).HasComment("海报地址");
            entity.Property(e => e.QuantityIssued).HasComment("发放数量");
            entity.Property(e => e.ReceiveEndTime).HasComment("领取结束时间（用户可领取该优惠券的截止时间，超出则无法领取）");
            entity.Property(e => e.ReceiveStartTime).HasComment("领取开始时间（用户可领取该优惠券的起始时间）");
            entity.Property(e => e.SchemeType)
                .HasDefaultValue(0)
                .HasComment("方案类型：0=非消费券，1=消费者承担服务费，2=商家承担服务费");
            entity.Property(e => e.StoreId).HasComment("所属门店ID");
            entity.Property(e => e.TemplateCode).HasComment("优惠券模板编号");
            entity.Property(e => e.Total)
                .HasDefaultValue(0)
                .HasComment("总数量");
            entity.Property(e => e.UseFrequencyLimit)
                .HasDefaultValue(1)
                .HasComment("每个周期内最大使用次数（如每日限用1次则填1）");
            entity.Property(e => e.UseFrequencyType)
                .HasDefaultValue(1)
                .HasComment("使用频率限制：1=无限制，2=每日，3=每周");
            entity.Property(e => e.UseThresholdAmount)
                .HasDefaultValue(0L)
                .HasComment("使用门槛金额");
            entity.Property(e => e.UsedCount)
                .HasDefaultValue(0)
                .HasComment("已使用数量");
            entity.Property(e => e.ValidityDuration).HasComment("有效期时长（ValidityType=2时必填，单位：小时）");
            entity.Property(e => e.ValidityEndTime).HasComment("固定有效期的结束时间（当ValidityType=1时必填）");
            entity.Property(e => e.ValidityStartTime).HasComment("固定有效期的开始时间（当ValidityType=1时必填）");
            entity.Property(e => e.ValidityType)
                .HasDefaultValue(1)
                .HasComment("有效期类型：1=固定时间范围（所有券统一可用时间），2=领取后N小时内可用");
        });

        modelBuilder.Entity<DividedAgreement>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("Agreement_pkey");

            entity.ToTable("DividedAgreement", tb => tb.HasComment("分账协议表"));

            entity.Property(e => e.Id).HasComment("分账协议ID");
            entity.Property(e => e.ActivationStatus)
                .HasDefaultValue(1)
                .HasComment("激活状态(0=未激活，1=已激活，系统判断)");
            entity.Property(e => e.AgreementCode).HasComment("分账协议编号");
            entity.Property(e => e.AgreementName).HasComment("分账协议名称");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建人ID");
            entity.Property(e => e.DeleterId).HasComment("删除者ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.DividedCycle)
                .HasDefaultValue(0)
                .HasComment("分账周期");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(0)
                .HasComment("启用状态(0=禁用，1=启用，用户设置)");
            entity.Property(e => e.EndTime).HasComment("失效时间（为空为长期有效）");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IsDeleted)
                .HasDefaultValue(false)
                .HasComment("是否删除");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改人ID");
            entity.Property(e => e.MerchantId).HasComment("所属商户ID");
            entity.Property(e => e.ParentAgreementId).HasComment("父级协议ID");
            entity.Property(e => e.StartTime).HasComment("生效时间");
        });

        modelBuilder.Entity<DividedAgreementDetail>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("SharingAgreementUser_pkey");

            entity.ToTable("DividedAgreementDetail", tb => tb.HasComment("分账协议详情表"));

            entity.Property(e => e.Id).HasComment("分账协议详情ID");
            entity.Property(e => e.ActivationStatus)
                .HasDefaultValue(0)
                .HasComment("激活状态(0=未激活，1=已激活，用户确认后激活)");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.DividedAgreementId).HasComment("分账协议ID");
            entity.Property(e => e.IsMasterAccount)
                .HasDefaultValue(false)
                .HasComment("是否是主账户");
            entity.Property(e => e.Ratio)
                .HasDefaultValueSql("0")
                .HasComment("分账比例");
            entity.Property(e => e.SubAgreementId).HasComment("子协议ID");
            entity.Property(e => e.UserId).HasComment("用户ID");
            entity.Property(e => e.UserRoleId).HasComment("用户角色ID");
        });

        modelBuilder.Entity<DividedRecord>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("DividedRecord_pkey");

            entity.ToTable("DividedRecord", tb => tb.HasComment("分账记录表"));

            entity.Property(e => e.Id).HasComment("分账记录ID");
            entity.Property(e => e.CodeId).HasComment("收款码ID");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建者ID");
            entity.Property(e => e.DividedAgreementId).HasComment("分账协议ID");
            entity.Property(e => e.DividedDate).HasComment("分账日期");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.LastModificationTime).HasComment("修改时间");
            entity.Property(e => e.LastModifierId).HasComment("修改者ID");
            entity.Property(e => e.MerchantId).HasComment("商户ID");
            entity.Property(e => e.OrderId).HasComment("关联订单ID");
            entity.Property(e => e.RecordNo).HasComment("分账记录编号");
            entity.Property(e => e.StoreId).HasComment("门店ID");
            entity.Property(e => e.TotalDividedAmount)
                .HasDefaultValue(0L)
                .HasComment("分账总金额");
        });

        modelBuilder.Entity<DividedRecordDetail>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("DividedRecordDetail_pkey");

            entity.ToTable("DividedRecordDetail", tb => tb.HasComment("分账记录详情表"));

            entity.Property(e => e.Id).HasComment("分账记录详情ID");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.DividedAmount)
                .HasDefaultValue(0L)
                .HasComment("分账金额");
            entity.Property(e => e.DividedRecordId).HasComment("分账记录ID");
            entity.Property(e => e.EntryTime).HasComment("入账时间");
            entity.Property(e => e.IsEntry)
                .HasDefaultValue(false)
                .HasComment("是否入账");
            entity.Property(e => e.IsMasterAccount)
                .HasDefaultValue(false)
                .HasComment("是否是主账户");
            entity.Property(e => e.LayerAgreementId).HasComment("有效层协议ID（当前分账详情所处层）");
            entity.Property(e => e.PathAgreementCount).HasComment("路径包含协议数量");
            entity.Property(e => e.PathDepth).HasComment("路径深度（层数）");
            entity.Property(e => e.PathJson).HasComment("从根到叶的分账路径(JSON：协议ID与比例序列)");
            entity.Property(e => e.Ratio).HasComment("分账比例");
            entity.Property(e => e.RootAgreementId).HasComment("根层协议ID（分账溯源用）");
            entity.Property(e => e.UserId).HasComment("分账接收方用户ID");
        });

        modelBuilder.Entity<EpaylinksSplitRecord>(entity =>
        {
            entity.ToTable("EpaylinksSplitRecord", tb => tb.HasComment("易票联分账记录表"));

            entity.Property(e => e.Id).HasComment("分账记录ID");
            entity.Property(e => e.ActualAmount).HasComment("实际提现金额，单位为分");
            entity.Property(e => e.Amount).HasComment("分账金额，单位为分");
            entity.Property(e => e.ApiResponse).HasComment("请求后响应JSON");
            entity.Property(e => e.AttachData).HasComment("商户备注");
            entity.Property(e => e.CallbackData).HasComment("回调参数JSON");
            entity.Property(e => e.CallbackTime).HasComment("回调接收时间");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.CustomerCode).HasComment("商户编号");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.Fee).HasComment("手续费，单位为分");
            entity.Property(e => e.FeeRate).HasComment("费率");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.MemberId).HasComment("分账商户编号");
            entity.Property(e => e.MerchantId).HasComment("商户ID");
            entity.Property(e => e.NonceStr).HasComment("随机字符串");
            entity.Property(e => e.NotifyUrl).HasComment("通知地址");
            entity.Property(e => e.OutSplitTradeNo).HasComment("商户分账单号");
            entity.Property(e => e.OutTradeNo).HasComment("商户订单号（分账订单号）");
            entity.Property(e => e.ProcedureFee).HasComment("分账手续费（单位为分）");
            entity.Property(e => e.RealAmount).HasComment("实际分账金额");
            entity.Property(e => e.RequestData).HasComment("请求参数JSON");
            entity.Property(e => e.RequestTime).HasComment("分账请求时间");
            entity.Property(e => e.RevokeTransactionNo).HasComment("撤销单号");
            entity.Property(e => e.SplitState).HasComment("分账结果（00=分账成功，01=分账失败，03=处理中，04=预分帐成功，05=已撤销，51=待处理）");
            entity.Property(e => e.SplitStatus)
                .HasDefaultValue(0)
                .HasComment("分账状态：0=处理中,1=分账成功,2=分账失败,3=预分帐成功，4=已撤销，5=待处理");
            entity.Property(e => e.SplitTime).HasComment("分账完成时间");
            entity.Property(e => e.SplitTransactionNo).HasComment("易票联分账单号");
            entity.Property(e => e.TransactionNo).HasComment("易票联订单号");
            entity.Property(e => e.UserId).HasComment("用户ID");
        });

        modelBuilder.Entity<ErrorLog>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("ErrorLog_pkey");

            entity.ToTable("ErrorLog", tb => tb.HasComment("错误日志表"));

            entity.Property(e => e.Id).HasComment("错误日志ID");
            entity.Property(e => e.Api).HasComment("引发错误的接口地址");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.Ip).HasComment("请求IP");
            entity.Property(e => e.Message).HasComment("错误消息");
            entity.Property(e => e.Params).HasComment("本次请求的参数");
            entity.Property(e => e.UserId).HasComment("用户ID");
        });

        modelBuilder.Entity<LinePunchRecord>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("LinePunchRecord_pkey");

            entity.ToTable("LinePunchRecord", tb => tb.HasComment("线路打卡记录表"));

            entity.Property(e => e.Id).HasComment("打卡Id");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.EndTime).HasComment("完成时间");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性（JSON文本）");
            entity.Property(e => e.LineId).HasComment("线路Id");
            entity.Property(e => e.StartTime).HasComment("开始时间");
            entity.Property(e => e.UserId).HasComment("用户Id");
        });

        modelBuilder.Entity<LoginLog>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("LoginLog_pkey");

            entity.ToTable("LoginLog", tb => tb.HasComment("登录日志表"));

            entity.Property(e => e.Id).HasComment("登录日志ID");
            entity.Property(e => e.Account).HasComment("用户账户");
            entity.Property(e => e.Code).HasComment("凭据");
            entity.Property(e => e.CreationTime).HasComment("登录时间");
            entity.Property(e => e.Explain).HasComment("描述");
            entity.Property(e => e.Ip).HasComment("登录IP");
            entity.Property(e => e.Result).HasComment("结果");
            entity.Property(e => e.Type).HasComment("类型");
            entity.Property(e => e.UserId).HasComment("用户Id");
        });

        modelBuilder.Entity<LotteryActivity>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("LotteryActivity_pkey");

            entity.ToTable("LotteryActivity", tb => tb.HasComment("抽奖活动表"));

            entity.Property(e => e.Id).HasComment("活动ID");
            entity.Property(e => e.ActivityCode).HasComment("活动编号");
            entity.Property(e => e.ActivityRules).HasComment("活动规则");
            entity.Property(e => e.Channel).HasComment("渠道/入口");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.ConfigVersion).HasComment("配置版本号（前后端一致性校验）");
            entity.Property(e => e.CooldownSeconds)
                .HasDefaultValue(0)
                .HasComment("参与冷却时间（秒）");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建人ID");
            entity.Property(e => e.DailyLimit)
                .HasDefaultValue(0)
                .HasComment("用户每日参与次数上限（0=不限）");
            entity.Property(e => e.DeleterId).HasComment("删除人ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(1)
                .HasComment("启用状态：0=禁用，1=启用");
            entity.Property(e => e.EndTime).HasComment("活动结束时间");
            entity.Property(e => e.ExpirationTime).HasComment("过期时间（单位秒）");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性（JSON文本）");
            entity.Property(e => e.IsDeleted)
                .HasDefaultValue(false)
                .HasComment("是否删除");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改人ID");
            entity.Property(e => e.Name).HasComment("活动名称");
            entity.Property(e => e.RegisterIdentityCard).HasComment("是否需要登记身份证");
            entity.Property(e => e.RegisterPhone).HasComment("是否需要登记手机号");
            entity.Property(e => e.StartTime).HasComment("活动开始时间");
            entity.Property(e => e.Status)
                .HasDefaultValue(1)
                .HasComment("活动状态：1=草稿，2=上架，3=下架");
            entity.Property(e => e.TotalLimit)
                .HasDefaultValue(0)
                .HasComment("用户在活动期间总参与次数上限（0=不限）");
            entity.Property(e => e.Type).HasComment("活动类型：0=默认，1=九宫格，2=转盘");
        });

        modelBuilder.Entity<LotteryClaimRecord>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("LotteryClaimRecord_pkey");

            entity.ToTable("LotteryClaimRecord", tb => tb.HasComment("抽奖与发券记录"));

            entity.Property(e => e.Id).HasComment("抽奖记录ID");
            entity.Property(e => e.ActivityId).HasComment("活动ID");
            entity.Property(e => e.AwardId).HasComment("奖品ID，NULL 表示“谢谢参与”");
            entity.Property(e => e.Channel).HasComment("渠道/入口");
            entity.Property(e => e.ConfigVersion).HasComment("抽奖时携带的配置版本");
            entity.Property(e => e.CouponId).HasComment("券实例ID（如发券成功则记录）");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("记录时间");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性（JSON文本）");
            entity.Property(e => e.Issued)
                .HasDefaultValue(false)
                .HasComment("是否发券成功");
            entity.Property(e => e.Message).HasComment("文案/错误信息");
            entity.Property(e => e.RequestId).HasComment("防重入请求ID（唯一）");
            entity.Property(e => e.Status)
                .HasDefaultValue(0)
                .HasComment("结果状态：0=失败，1=成功，2=实名未完成");
            entity.Property(e => e.TargetCell).HasComment("多宫格命中格子（如使用动效）");
            entity.Property(e => e.TargetSlot).HasComment("转盘命中盘位（如使用动效）");
            entity.Property(e => e.TemplateId).HasComment("中奖对应的券模板ID（快照）");
            entity.Property(e => e.UserId).HasComment("用户ID");
        });

        modelBuilder.Entity<LotteryPrize>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("LotteryPrize_pkey");

            entity.ToTable("LotteryPrize", tb => tb.HasComment("抽奖奖品表"));

            entity.Property(e => e.Id).HasComment("奖品ID");
            entity.Property(e => e.ActivityId).HasComment("所属活动ID");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.Enabled)
                .HasDefaultValue(true)
                .HasComment("启用状态（true=启用，false=禁用）");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性（JSON文本）");
            entity.Property(e => e.Name).HasComment("奖品名称");
            entity.Property(e => e.PrizeCode).HasComment("奖品编号");
            entity.Property(e => e.Ratio).HasComment("奖品自身抽中概率（比例值），有效奖品概率和≤1，其余视为“谢谢参与”");
            entity.Property(e => e.Sort)
                .HasDefaultValue(0)
                .HasComment("排序（用于展示/配置）");
            entity.Property(e => e.Stock)
                .HasDefaultValue(0)
                .HasComment("奖品库存（中奖后扣减）");
            entity.Property(e => e.TemplateId).HasComment("关联优惠券模板ID（中奖后发券使用）");
        });

        modelBuilder.Entity<Merchant>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("Merchant_pkey");

            entity.ToTable("Merchant", tb => tb.HasComment("商户表"));

            entity.Property(e => e.Id).HasComment("商户ID");
            entity.Property(e => e.AcceptOrder).HasComment("是否收单");
            entity.Property(e => e.AccountStatus)
                .HasDefaultValue(0)
                .HasComment("账户状态（0：未开通，1：已开通，2：冻结；3：注销；4：止付；5：禁止入金）");
            entity.Property(e => e.AcqMerId).HasComment("商户编号");
            entity.Property(e => e.AcqSpId).HasComment("平台商户编号");
            entity.Property(e => e.Address).HasComment("商户地址");
            entity.Property(e => e.AuditMsg).HasComment("审核说明");
            entity.Property(e => e.AuditStatus)
                .HasDefaultValue(0)
                .HasComment("审核状态（1：待审核; 2：审核通过; 3：审核未通\r\n过）");
            entity.Property(e => e.AuditTime).HasComment("审核时间");
            entity.Property(e => e.BackUrl).HasComment("审核结果通知地址");
            entity.Property(e => e.Business).HasComment("业务开通信息");
            entity.Property(e => e.BusinessBackUrl).HasComment("业务启停回调地址");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.ContactPerson).HasComment("联系人名称");
            entity.Property(e => e.ContactPhone).HasComment("联系电话");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建人ID");
            entity.Property(e => e.DeleterId).HasComment("删除者ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.DetailedAddress).HasComment("商户详细地址");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(0)
                .HasComment("启用状态");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IsDeleted)
                .HasDefaultValue(false)
                .HasComment("是否删除");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改者ID");
            entity.Property(e => e.Location).HasComment("经纬度");
            entity.Property(e => e.MerId).HasComment("商户侧唯一标识");
            entity.Property(e => e.MerchantCode).HasComment("商户编号");
            entity.Property(e => e.MerchantName).HasComment("商户名称");
            entity.Property(e => e.MerchantType)
                .HasDefaultValue(0)
                .HasComment("商户类型");
            entity.Property(e => e.Name).HasComment("商户名称");
            entity.Property(e => e.Paper).HasComment("商户详细信息");
            entity.Property(e => e.PaymentPlatformId).HasComment("支付平台ID");
            entity.Property(e => e.SettlementCycle)
                .HasDefaultValue(1)
                .HasComment("结算周期");
            entity.Property(e => e.Version).HasComment("版本号");
        });

        modelBuilder.Entity<Order>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("PK_AiCollection_Orders");

            entity.ToTable("Order", tb => tb.HasComment("订单表"));

            entity.Property(e => e.Id).HasComment("订单ID");
            entity.Property(e => e.AlipayStoreCode).HasComment("支付宝门店编号");
            entity.Property(e => e.AlipayStoreId).HasComment("支付宝门店ID");
            entity.Property(e => e.AreaInfo).HasComment("地区信息");
            entity.Property(e => e.AttachData).HasComment("商户备注");
            entity.Property(e => e.BuyerId).HasComment("买家的支付宝唯一用户号，长度为 28 位的字符串，支付宝类交易需要返回，2088 开头的 16 位纯数字。");
            entity.Property(e => e.BuyerLogonId).HasComment("买家的支付宝账号，长度为 100 位的字符串，支付宝类交易需要返回。");
            entity.Property(e => e.CashAmount).HasComment("应结订单金额，单位分，可选参数。");
            entity.Property(e => e.ChannelMchtNo).HasComment("上游商户号");
            entity.Property(e => e.ChannelOrder).HasComment("上游订单号");
            entity.Property(e => e.ClientIp).HasComment("用户终端 IP");
            entity.Property(e => e.CodeId).HasComment("收款码ID");
            entity.Property(e => e.Commission)
                .HasDefaultValue(0L)
                .HasComment("手续费");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.CouponAmount).HasComment("代金券金额，单位分，可选参数。");
            entity.Property(e => e.CouponDetails).HasComment("优惠信息，使用优惠券时必须，参考 couponDetails 说明。");
            entity.Property(e => e.CouponInstanceId).HasComment("优惠券实例ID");
            entity.Property(e => e.Coupons).HasComment("优惠编码");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建人ID");
            entity.Property(e => e.CustomerCode).HasComment("商户编号");
            entity.Property(e => e.DeleterId).HasComment("删除者ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.DeviceId).HasComment("支付设备ID");
            entity.Property(e => e.DiscountAmount)
                .HasDefaultValue(0L)
                .HasComment("优惠金额");
            entity.Property(e => e.DividedAgreementId).HasComment("分账协议ID");
            entity.Property(e => e.DividedDate).HasComment("分账日期(根据分账周期算出 只取日期部分 时间为 00:00:00)");
            entity.Property(e => e.DividedTime).HasComment("分账时间");
            entity.Property(e => e.EnablePayChannels).HasComment("分期可用渠道");
            entity.Property(e => e.ExtUserInfo).HasComment("付款人信息（微信、支付宝支付时有效）");
            entity.Property(e => e.ExtendParams).HasComment("扩展参数");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.InstalmentsNum).HasComment("分期期数");
            entity.Property(e => e.IpInfo).HasComment("分期信息，JSON 对象，分期支付时必填，参考“分期 IPInfo 对象”。");
            entity.Property(e => e.IpProtocolVersion).HasComment("分期协议版本号，分期必需。");
            entity.Property(e => e.Irr).HasComment("签约折算年化利率，分期必需，详见年化内部收益率（IRR）计算公式，百分比数字，保留两位小数，示例：15.18%年化率取值：15.18。");
            entity.Property(e => e.IrrType).HasComment("年化利率计费方式，分期必需，1：单利，2：复利。");
            entity.Property(e => e.IsDeleted)
                .HasDefaultValue(false)
                .HasComment("是否删除");
            entity.Property(e => e.IsDivided)
                .HasDefaultValue(0)
                .HasComment("是否分账");
            entity.Property(e => e.IsSettlement)
                .HasDefaultValue(0)
                .HasComment("是否结算");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改者ID");
            entity.Property(e => e.LastRefundTime).HasComment("最后退款时间");
            entity.Property(e => e.MerchantId).HasComment("商户ID");
            entity.Property(e => e.NfcTagId).HasComment("标签 ID，长度为 14 位的字符串，碰一碰类型交易返回。");
            entity.Property(e => e.NoCreditCards).HasComment("是否禁止信用卡支付");
            entity.Property(e => e.NonceStr).HasComment("随机字符串");
            entity.Property(e => e.NotifyUrl).HasComment("支付结果通知地址");
            entity.Property(e => e.OpenId).HasComment("用户在 appId 下的唯一标识，长度为 32 位的字符串，微信类交易需要返回。");
            entity.Property(e => e.OrderAmount).HasComment("订单金额");
            entity.Property(e => e.OrderCode).HasComment("订单编号");
            entity.Property(e => e.OrderInfo).HasComment("商品订单信息");
            entity.Property(e => e.OrderSnapshot).HasComment("订单快照");
            entity.Property(e => e.OrderType)
                .HasDefaultValue(0)
                .HasComment("订单类型");
            entity.Property(e => e.OutTradeNo).HasComment("商户订单号");
            entity.Property(e => e.PayAmount)
                .HasDefaultValue(0L)
                .HasComment("支付金额，单位为分");
            entity.Property(e => e.PayCurrency).HasComment("支付币种：默讣CNY人民币 ");
            entity.Property(e => e.PayMethod).HasComment("支付方式");
            entity.Property(e => e.PayServiceCharged).HasComment("支付服务费，单位分");
            entity.Property(e => e.PaymentStatus)
                .HasDefaultValue(0)
                .HasComment("支付状态(0=处理中，1=支付成功​，2=支付失败​​，3=已撤销，4=已关闭，5=已超时​​)");
            entity.Property(e => e.PaymentTime).HasComment("支付完成时间");
            entity.Property(e => e.PlatformServiceFee)
                .HasDefaultValue(0L)
                .HasComment("平台服务费（优惠券使用产生）");
            entity.Property(e => e.PlatformServiceFeeRate)
                .HasDefaultValueSql("0")
                .HasComment("平台服务费率（优惠券使用产生）");
            entity.Property(e => e.ProcedureFee).HasComment("手续费，交易过程中产生的手续费用");
            entity.Property(e => e.Rate).HasComment("费率");
            entity.Property(e => e.RecommendMerchantId).HasComment("推荐商户ID");
            entity.Property(e => e.RecommendationCommissionAmount)
                .HasDefaultValue(0L)
                .HasComment("优惠券推荐抽成金额");
            entity.Property(e => e.RedirectUrl).HasComment("商户支付结果展示地址");
            entity.Property(e => e.RefundCount)
                .HasDefaultValue(0)
                .HasComment("退款次数");
            entity.Property(e => e.RefundProcessStatus)
                .HasDefaultValue(0)
                .HasComment("退款处理状态(0=无退款进行中,1=退款处理中)");
            entity.Property(e => e.RefundStatus)
                .HasDefaultValue(0)
                .HasComment("退款结果状态(0=未退款,1=部分退款,2=全额退款)");
            entity.Property(e => e.RefundableAmount)
                .HasDefaultValue(0L)
                .HasComment("可退款金额（实收金额 - 累计退款金额）");
            entity.Property(e => e.Remark).HasComment("交易说明，长度为 100 位的字符串，可选参数。");
            entity.Property(e => e.Reserved).HasComment("保留信息，长度为 400 位的字符串，参考“reserved 字段说明”，可选参数。");
            entity.Property(e => e.SettlementAmount)
                .HasDefaultValue(0L)
                .HasComment("结算金额");
            entity.Property(e => e.SettlementDate).HasComment("结算日期(根据结算周期算出 只取日期部分 时间为 00:00:00)");
            entity.Property(e => e.SettlementTime).HasComment("结算时间");
            entity.Property(e => e.StoreId).HasComment("门店ID");
            entity.Property(e => e.SubAppId).HasComment("子商户公众号appid");
            entity.Property(e => e.SubOpenId).HasComment("用户在子商户 appId 下的唯一标识，长度为 32 位的字符串，微信类交易需要返回。");
            entity.Property(e => e.TerminalInfo).HasComment("终端信息");
            entity.Property(e => e.TerminalName).HasComment("终端名称");
            entity.Property(e => e.TerminalNo).HasComment("终端号");
            entity.Property(e => e.TotalRefundAmount)
                .HasDefaultValue(0L)
                .HasComment("累计退款金额");
            entity.Property(e => e.TransactionEndTime).HasComment("交易超时时间");
            entity.Property(e => e.TransactionNo).HasComment("易票联订单号");
            entity.Property(e => e.TransactionStartTime).HasComment("交易开始时间");
            entity.Property(e => e.UserId).HasComment("支付用户ID");
            entity.Property(e => e.Version).HasComment("版本号");
        });

        modelBuilder.Entity<OrderRefundRecord>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("OrderRefundRecord_pkey");

            entity.ToTable("OrderRefundRecord", tb => tb.HasComment("订单退款记录表"));

            entity.Property(e => e.Id).HasComment("订单退款ID");
            entity.Property(e => e.ApiResponse).HasComment("API响应JSON（记录退款接口响应数据）");
            entity.Property(e => e.BackSplitProcedureFee).HasComment("退回分账手续费（单位分）");
            entity.Property(e => e.BackpayProcedurefee).HasComment("退回收单手续费（单位分）");
            entity.Property(e => e.CallbackData).HasComment("回调参数JSON（记录退款回调数据）");
            entity.Property(e => e.ChannelTradeNo).HasComment("上游订单号");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.CustomerCode).HasComment("商户编号");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IsAutoRefund).HasComment("是否全额退款");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.NonceStr).HasComment("随机字符串");
            entity.Property(e => e.NotifyUrl).HasComment("退款结果通知地址");
            entity.Property(e => e.OrderId).HasComment("订单ID");
            entity.Property(e => e.OrderInfo).HasComment("商品订单信息");
            entity.Property(e => e.OriginalAmount).HasComment("原订单金额（单位分）");
            entity.Property(e => e.OutRefundNo).HasComment("商户退款单号（退款单号，代表本次退款申请交易）");
            entity.Property(e => e.OutSplitTradeNo).HasComment("商户分账单号（拆单分账时有效）");
            entity.Property(e => e.OutTradeNo).HasComment("商户订单号");
            entity.Property(e => e.ProcedureFee).HasComment("退款手续费（单位分）");
            entity.Property(e => e.RefundAmount).HasComment("申请退款金额（单位分）");
            entity.Property(e => e.RefundDetail).HasComment("优惠退款详情（JSON格式）");
            entity.Property(e => e.RefundReason).HasComment("退款原因");
            entity.Property(e => e.RefundState).HasComment("退款执行结果");
            entity.Property(e => e.RefundTime).HasComment("退款时间");
            entity.Property(e => e.Remark).HasComment("退款申请说明");
            entity.Property(e => e.RequestData).HasComment("请求参数JSON（记录完整的退款请求参数）");
            entity.Property(e => e.Reserved).HasComment("保留信息");
            entity.Property(e => e.ReturnToList).HasComment("退款路径（JSON格式）");
            entity.Property(e => e.SplitInfoList).HasComment("分账退款信息列表（JSON格式）");
            entity.Property(e => e.Status).HasComment("状态（0=处理中，1=成功，2=失败）");
            entity.Property(e => e.TransactionNo).HasComment("易票联订单号");
            entity.Property(e => e.Version).HasComment("版本号");
        });

        modelBuilder.Entity<PaymentCode>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("PK_AiCollection_PaymentCodes");

            entity.ToTable("PaymentCode", tb => tb.HasComment("支付码表"));

            entity.Property(e => e.Id).HasComment("支付码ID");
            entity.Property(e => e.CascadeId).HasComment("级联ID，用于多级关联");
            entity.Property(e => e.Code).HasComment("支付码编号");
            entity.Property(e => e.CodeName).HasComment("支付码名称");
            entity.Property(e => e.CodeUrl).HasComment("支付码URL");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建者ID");
            entity.Property(e => e.DeleterId).HasComment("删除者ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.DeviceId).HasComment("支付设备ID");
            entity.Property(e => e.DividedAgreementId).HasComment("分账协议ID");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(0)
                .HasComment("启用状态");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IsDeleted)
                .HasDefaultValue(false)
                .HasComment("是否删除");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改者ID");
            entity.Property(e => e.MerchantId).HasComment("商户ID");
            entity.Property(e => e.ParentId).HasComment("父级支付码ID");
            entity.Property(e => e.SettlementCycle)
                .HasDefaultValue(0)
                .HasComment("结算周期");
            entity.Property(e => e.StoreId).HasComment("门店ID");
        });

        modelBuilder.Entity<PaymentDevice>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("PK_AiCollection_PaymentDevices");

            entity.ToTable(tb => tb.HasComment("支付设备表"));

            entity.Property(e => e.Id).HasComment("支付设备编号");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建者ID");
            entity.Property(e => e.DeleterId).HasComment("删除者ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.DeviceCode).HasComment("设备编码");
            entity.Property(e => e.DeviceStatus).HasComment("设备状态");
            entity.Property(e => e.DeviceType).HasComment("设备类型");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(0)
                .HasComment("启用状态");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IsDeleted)
                .HasDefaultValue(false)
                .HasComment("是否删除");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改者ID");
            entity.Property(e => e.Name).HasComment("设备名称");
            entity.Property(e => e.PurchaseTime).HasComment("购买时间");
            entity.Property(e => e.SerialNumber).HasComment("序列号");
            entity.Property(e => e.StoreId).HasComment("门店ID");
            entity.Property(e => e.WarrantyExpirationTime).HasComment("保修截止时间");
        });

        modelBuilder.Entity<PaymentPlatform>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("PK_AiCollection_PaymentPlatforms");

            entity.ToTable(tb => tb.HasComment("支付平台表"));

            entity.Property(e => e.Id).HasComment("支付平台ID");
            entity.Property(e => e.AcceptOrder).HasComment("是否接单");
            entity.Property(e => e.AcqSpId).HasComment("收单服务商ID");
            entity.Property(e => e.ActivationStatus)
                .HasDefaultValue(0)
                .HasComment("激活状态");
            entity.Property(e => e.AppId).HasComment("应用ID");
            entity.Property(e => e.ApproveMessage).HasComment("审核消息");
            entity.Property(e => e.Balance)
                .HasDefaultValue(0L)
                .HasComment("账户余额");
            entity.Property(e => e.CallbackUrl).HasComment("回调URL");
            entity.Property(e => e.CascadeId).HasComment("级联ID");
            entity.Property(e => e.Code).HasComment("平台编号");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建者ID");
            entity.Property(e => e.DeleterId).HasComment("删除者ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.Description).HasComment("备注");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(0)
                .HasComment("启用状态");
            entity.Property(e => e.EpaylinksApprovedTime).HasComment("Epaylinks审核通过时间");
            entity.Property(e => e.EpaylinksAuditNotificationTime).HasComment("Epaylinks审核通知时间");
            entity.Property(e => e.EpaylinksBusinessNotificationTime).HasComment("Epaylinks业务通知时间");
            entity.Property(e => e.EpaylinksFirstApplyTime).HasComment("Epaylinks首次申请时间");
            entity.Property(e => e.EpaylinksLastApplyTime).HasComment("Epaylinks最后申请时间");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IsDeleted)
                .HasDefaultValue(false)
                .HasComment("是否删除");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("修改者ID");
            entity.Property(e => e.MerchantType)
                .HasDefaultValue(0)
                .HasComment("商户类型");
            entity.Property(e => e.Name).HasComment("名称");
            entity.Property(e => e.SecretKey).HasComment("密钥");
            entity.Property(e => e.UnsettledBalance)
                .HasDefaultValue(0L)
                .HasComment("未结算余额");
            entity.Property(e => e.VirtualBalance)
                .HasDefaultValue(0L)
                .HasComment("虚拟余额");
            entity.Property(e => e.WithdrawableBalance)
                .HasDefaultValue(0L)
                .HasComment("可提现余额");
            entity.Property(e => e.WithdrawalMethod)
                .HasDefaultValue(0)
                .HasComment("提现方式");
        });

        modelBuilder.Entity<RateConfig>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("RateConfig_pkey");

            entity.ToTable("RateConfig", tb => tb.HasComment("费率配置表"));

            entity.Property(e => e.Id).HasComment("费率配置ID");
            entity.Property(e => e.AmountRangeEnd).HasComment("金额区间结束值（单位：分，null表示无限制）");
            entity.Property(e => e.AmountRangeStart).HasComment("金额区间起始值（单位：分，null表示无限制）");
            entity.Property(e => e.BusinessType).HasComment("业务类型：1=微信支付,2=支付宝,3=银行卡,4=现金,5=其他");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建者ID");
            entity.Property(e => e.EffectiveTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("生效时间");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(0)
                .HasComment("启用状态");
            entity.Property(e => e.ExpiryTime).HasComment("失效时间（null表示永久有效）");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改者ID");
            entity.Property(e => e.MaxFee).HasComment("最高费用（单位：分）");
            entity.Property(e => e.MerchantId).HasComment("商户ID（null表示全局费率）");
            entity.Property(e => e.MinFee).HasComment("最低费用（单位：分）");
            entity.Property(e => e.PaymentPlatformId).HasComment("支付平台ID（null表示通用费率）");
            entity.Property(e => e.Priority)
                .HasDefaultValue(0)
                .HasComment("优先级（数值越大优先级越高）");
            entity.Property(e => e.RateName).HasComment("费率名称");
            entity.Property(e => e.RateType).HasComment("费率类型：1=支付费率,2=提现费率,3=分账费率,4=退款费率");
            entity.Property(e => e.RateValue).HasComment("费率值（小数形式，如0.006表示0.6%）");
            entity.Property(e => e.Remark).HasComment("备注说明");
            entity.Property(e => e.StoreId).HasComment("门店ID（null表示商户级费率）");
        });

        modelBuilder.Entity<ReportStatistic>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("ReportStatistic_pkey");

            entity.ToTable("ReportStatistic", tb => tb.HasComment("报表统计表"));

            entity.Property(e => e.Id).HasComment("报表统计ID");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.CustomerCount)
                .HasDefaultValue(0)
                .HasComment("顾客数");
            entity.Property(e => e.DiscountStat).HasComment("优惠统计(JSON格式)");
            entity.Property(e => e.DividedAmount)
                .HasDefaultValue(0L)
                .HasComment("分账金额");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.MerchantId).HasComment("商户ID");
            entity.Property(e => e.NetAmount)
                .HasDefaultValue(0L)
                .HasComment("净金额(收款-退款)");
            entity.Property(e => e.PaymentCodeId).HasComment("收款码ID");
            entity.Property(e => e.PaymentMethodStat).HasComment("支付方式统计(JSON格式)");
            entity.Property(e => e.ReceiptAmount)
                .HasDefaultValue(0L)
                .HasComment("收款金额");
            entity.Property(e => e.ReceiptOrderCount)
                .HasDefaultValue(0)
                .HasComment("收款订单数");
            entity.Property(e => e.RefundAmount)
                .HasDefaultValue(0L)
                .HasComment("退款金额");
            entity.Property(e => e.RefundOrderCount)
                .HasDefaultValue(0)
                .HasComment("退款订单数");
            entity.Property(e => e.ReportDate).HasComment("报表日期");
            entity.Property(e => e.ReportPeriod).HasComment("报表周期(如:2025-07-01,2025第27周,2025-07)");
            entity.Property(e => e.ReportType).HasComment("报表类型(1=日报,2=周报,3=月报)");
            entity.Property(e => e.SettledAmount)
                .HasDefaultValue(0L)
                .HasComment("结算金额");
            entity.Property(e => e.StoreId).HasComment("门店ID");
            entity.Property(e => e.WeeklyComparison).HasComment("近四周收入对比(JSON格式)");
        });

        modelBuilder.Entity<SettlementRecord>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("Settlement_pkey");

            entity.ToTable("SettlementRecord", tb => tb.HasComment("结算记录表"));

            entity.Property(e => e.Id).HasComment("结算记录ID");
            entity.Property(e => e.Commission)
                .HasDefaultValue(0L)
                .HasComment("手续费");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.DiscountCount)
                .HasDefaultValue(0)
                .HasComment("优惠笔数");
            entity.Property(e => e.FailureReason).HasComment("失败原因");
            entity.Property(e => e.MerchantId).HasComment("商户ID");
            entity.Property(e => e.PlatformServiceFee)
                .HasDefaultValue(0L)
                .HasComment("平台服务费");
            entity.Property(e => e.RefundCount)
                .HasDefaultValue(0)
                .HasComment("退款笔数");
            entity.Property(e => e.SettlementCount)
                .HasDefaultValue(0)
                .HasComment("结算笔数");
            entity.Property(e => e.SettlementDate).HasComment("结算日期(只取日期部分时间为 00:00:00)");
            entity.Property(e => e.SettlementNo).HasComment("结算记录编号");
            entity.Property(e => e.SettlementType).HasComment("结算类型(0=自动,1=手动结算)");
            entity.Property(e => e.Status)
                .HasDefaultValue(0)
                .HasComment("结算状态(0=结算失败,1=结算成功)");
            entity.Property(e => e.TotalActualReceivedAmount)
                .HasDefaultValue(0L)
                .HasComment("总实收金额");
            entity.Property(e => e.TotalDiscountAmount)
                .HasDefaultValue(0L)
                .HasComment("优惠总金额");
            entity.Property(e => e.TotalRefundAmount)
                .HasDefaultValue(0L)
                .HasComment("总退款金额");
            entity.Property(e => e.TotalSettledAmount)
                .HasDefaultValue(0L)
                .HasComment("总结算金额");
        });

        modelBuilder.Entity<Store>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("Store_pkey");

            entity.ToTable("Store", tb => tb.HasComment("门店表"));

            entity.Property(e => e.Id).HasComment("门店ID");
            entity.Property(e => e.Address).HasComment("门店地址");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.ContactPerson).HasComment("联系人名称");
            entity.Property(e => e.ContactPhone).HasComment("联系电话");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建人ID");
            entity.Property(e => e.DeleterId).HasComment("删除者ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.DetailedAddress).HasComment("门店详细地址");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(0)
                .HasComment("启用状态");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IsDeleted)
                .HasDefaultValue(false)
                .HasComment("是否删除");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改人ID");
            entity.Property(e => e.Location).HasComment("经纬度");
            entity.Property(e => e.MerchantId).HasComment("商户ID");
            entity.Property(e => e.Name).HasComment("门店名称");
            entity.Property(e => e.SettlementCycle)
                .HasDefaultValue(0)
                .HasComment("结算周期");
            entity.Property(e => e.StoreCode).HasComment("门店编号");
            entity.Property(e => e.StoreType)
                .HasDefaultValue(0)
                .HasComment("门店类型");
            entity.Property(e => e.ThumbnailUrl).HasComment("缩略图Url");
        });

        modelBuilder.Entity<SysPermission>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("Sys_Permission_pkey");

            entity.ToTable("Sys_Permission", tb => tb.HasComment("系统权限表"));

            entity.Property(e => e.Id).HasComment("权限ID");
            entity.Property(e => e.ApiPath).HasComment("API接口路径，仅API类型权限需要");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.Name).HasComment("权限名称");
            entity.Property(e => e.ParentId).HasComment("父级权限ID（用于构建权限层级）");
            entity.Property(e => e.Type).HasComment("权限类型：1=菜单，2=操作，3=API");
        });

        modelBuilder.Entity<SysRole>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("Sys_Role_pkey");

            entity.ToTable("Sys_Role", tb => tb.HasComment("系统角色表"));

            entity.Property(e => e.Id).HasComment("系统角色ID");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.Description).HasComment("角色描述");
            entity.Property(e => e.OrganizationType).HasComment("组织类型（0=平台，1=商户，2=门店）");
            entity.Property(e => e.RoleName).HasComment("角色名称");
            entity.Property(e => e.RoleType).HasComment("角色类型(0=平台超管，1=平台管理，2=超管，3=管理，4=监事，5=店长，6=收银员，7=业主，8=招商，9=城市合伙人，10=运营，11=技术，12=会员)");
        });

        modelBuilder.Entity<SysRolePermission>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("Sys_RolePermission_pkey");

            entity.ToTable("Sys_RolePermission", tb => tb.HasComment("系统角色权限关联表"));

            entity.Property(e => e.Id).HasComment("关联ID");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.PermId).HasComment("权限ID");
            entity.Property(e => e.RoleId).HasComment("角色ID");
        });

        modelBuilder.Entity<SysUser>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("Sys_User_pkey");

            entity.ToTable("Sys_User", tb => tb.HasComment("系统用户表"));

            entity.Property(e => e.Id).HasComment("用户Id");
            entity.Property(e => e.AvatarUrl).HasComment("用户头像URL");
            entity.Property(e => e.Balance)
                .HasDefaultValue(0L)
                .HasComment("账户余额，单位为分");
            entity.Property(e => e.BlockedBalance)
                .HasDefaultValue(0L)
                .HasComment("冻结余额，单位为分");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.CurrentUserRoleId).HasComment("用户选择商户团队成员ID");
            entity.Property(e => e.DividedBalance)
                .HasDefaultValue(0L)
                .HasComment("待分账余额，单位为分");
            entity.Property(e => e.Email).HasComment("邮箱");
            entity.Property(e => e.EnableStatus).HasComment("用户状态：0=禁用，1=启用");
            entity.Property(e => e.LastLoginTime).HasComment("用户最后登录时间");
            entity.Property(e => e.Name).HasComment("用户名");
            entity.Property(e => e.Password).HasComment("密码");
            entity.Property(e => e.Phone).HasComment("手机号");
            entity.Property(e => e.UnsettledBalance)
                .HasDefaultValue(0L)
                .HasComment("未结算余额，单位为分");
            entity.Property(e => e.WithdrawableBalance)
                .HasDefaultValue(0L)
                .HasComment("可提现余额，单位为分");
        });

        modelBuilder.Entity<SysUserMiniProgram>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("Sys_UserMiniProgram_pkey");

            entity.ToTable("Sys_UserMiniProgram", tb => tb.HasComment("C端用户表"));

            entity.Property(e => e.Id).HasComment("C端用户ID");
            entity.Property(e => e.AppId).HasComment("小程序ID");
            entity.Property(e => e.AvatarUrl).HasComment("用户头像URL");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.Email).HasComment("邮箱");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(1)
                .HasComment("启用状态");
            entity.Property(e => e.IdentityCard).HasComment("身份证");
            entity.Property(e => e.IsMain)
                .HasDefaultValue(false)
                .HasComment("是否为主小程序");
            entity.Property(e => e.LastLoginTime).HasComment("最后登录时间");
            entity.Property(e => e.Name).HasComment("用户昵称");
            entity.Property(e => e.OpenId).HasComment("用户在当前小程序中的唯一标识");
            entity.Property(e => e.Password).HasComment("密码（加密）");
            entity.Property(e => e.Phone).HasComment("手机号");
            entity.Property(e => e.PlatformType).HasComment("平台类型（1=微信,2=支付宝）");
            entity.Property(e => e.RealName).HasComment("真实姓名");
            entity.Property(e => e.UnionId).HasComment("用户在同一微信开放平台账号下所有应用（包括小程序、公众号等）的全局唯一标识");
            entity.Property(e => e.UserId).HasComment("支付宝用户唯一标识");
        });

        modelBuilder.Entity<SysUserRole>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("Sys_UserRole_pkey");

            entity.ToTable("Sys_UserRole", tb => tb.HasComment("系统用户角色关联表"));

            entity.Property(e => e.Id).HasComment("用户角色关联ID（团队成员ID）");
            entity.Property(e => e.CodeId).HasComment("所属收款码ID");
            entity.Property(e => e.ConcurrencyStamp).HasComment("并发标记");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.CreatorId).HasComment("创建人ID");
            entity.Property(e => e.DeleterId).HasComment("删除者ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.EnableStatus)
                .HasDefaultValue(0)
                .HasComment("启用状态");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IsDeleted)
                .HasDefaultValue(false)
                .HasComment("是否删除");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.LastModifierId).HasComment("最后修改人ID");
            entity.Property(e => e.MerchantId).HasComment("所属商户ID");
            entity.Property(e => e.Name).HasComment("成员昵称");
            entity.Property(e => e.RoleId).HasComment("角色ID");
            entity.Property(e => e.StoreId).HasComment("所属门店ID");
            entity.Property(e => e.UserId).HasComment("用户ID");
        });

        modelBuilder.Entity<WithdrawalAccount>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("WithdrawalAccount_pkey1");

            entity.ToTable("WithdrawalAccount", tb => tb.HasComment("提现账户表"));

            entity.Property(e => e.Id).HasComment("提现账户ID");
            entity.Property(e => e.AccountType)
                .HasDefaultValue(0)
                .HasComment("账户类型(0=未定义,1=对公账户,2=法人账户,3=授权对公,4=授权对私)");
            entity.Property(e => e.ActivationStatus).HasComment("激活状态");
            entity.Property(e => e.Address).HasComment("身份证详细地址");
            entity.Property(e => e.ApproveMessage).HasComment("审核消息");
            entity.Property(e => e.Bank).HasComment("开户银行名称");
            entity.Property(e => e.BankAccount).HasComment("银行账号");
            entity.Property(e => e.BankBranch).HasComment("开户银行支行名称");
            entity.Property(e => e.CreationTime).HasComment("创建时间");
            entity.Property(e => e.DeleterId).HasComment("删除者ID");
            entity.Property(e => e.DeletionTime).HasComment("删除时间");
            entity.Property(e => e.EnableStatus).HasComment("启用状态");
            entity.Property(e => e.EndDate).HasComment("有效期结束日期（无限制就不填）");
            entity.Property(e => e.EpaylinksApprovedTime).HasComment("Epaylinks审核通过时间");
            entity.Property(e => e.EpaylinksAuditNotificationTime).HasComment("Epaylinks审核通知时间");
            entity.Property(e => e.EpaylinksBusinessNotificationTime).HasComment("Epaylinks业务通知时间");
            entity.Property(e => e.EpaylinksFirstApplyTime).HasComment("Epaylinks首次申请时间");
            entity.Property(e => e.EpaylinksLastApplyTime).HasComment("Epaylinks最后申请时间");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.IdentityCard).HasComment("身份证号");
            entity.Property(e => e.IsDeleted).HasComment("是否删除");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.RealName).HasComment("真实姓名");
            entity.Property(e => e.StartDate).HasComment("有效期开始日期");
        });

        modelBuilder.Entity<WithdrawalRecord>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("WithdrawalRecord_pkey");

            entity.ToTable("WithdrawalRecord", tb => tb.HasComment("提现记录表"));

            entity.Property(e => e.Id).HasComment("提现记录ID");
            entity.Property(e => e.AccountTransactionId).HasComment("账户交易记录ID");
            entity.Property(e => e.ActualAmount)
                .HasDefaultValue(0L)
                .HasComment("实际到账金额");
            entity.Property(e => e.ActualFee).HasComment("实际提现到账金额（单位分，等于提现金额-手续费）");
            entity.Property(e => e.Amount)
                .HasDefaultValue(0L)
                .HasComment("提现金额");
            entity.Property(e => e.ApiResponse).HasComment("请求后响应JSON");
            entity.Property(e => e.ArrivalType).HasComment("到账类型（默认 0，最大 99；0：当日到账；1：\r\n次日到账，依此类推）");
            entity.Property(e => e.BankCardId).HasComment("银行卡标签");
            entity.Property(e => e.BankCardNo).HasComment("银行卡号");
            entity.Property(e => e.BankName).HasComment("银行名称");
            entity.Property(e => e.BankUserName).HasComment("收款人姓名");
            entity.Property(e => e.CallbackData).HasComment("回调参数JSON");
            entity.Property(e => e.ChannelQueryMsg).HasComment("原因说明");
            entity.Property(e => e.ChannelType).HasComment("渠道类型（0：门户；1：接口；2：自动提现）");
            entity.Property(e => e.CreationTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间");
            entity.Property(e => e.CustomerCode).HasComment("商户编号（平台商户编号）");
            entity.Property(e => e.EpaylinksSplitRecordId).HasComment("易票联分账记录ID");
            entity.Property(e => e.ExtraProperties).HasComment("扩展属性");
            entity.Property(e => e.Fee)
                .HasDefaultValue(0L)
                .HasComment("提现手续费");
            entity.Property(e => e.FeeRate)
                .HasDefaultValueSql("0")
                .HasComment("费率");
            entity.Property(e => e.IsFullAmount)
                .HasDefaultValue(0)
                .HasComment("是否全额（0：非全额，1：全额\r\n如果 isFullAmount 填了 1，则不管\r\npayAmount 的值）");
            entity.Property(e => e.LastModificationTime).HasComment("最后修改时间");
            entity.Property(e => e.MemberId).HasComment("分账商户编号");
            entity.Property(e => e.MerchantId).HasComment("商户ID");
            entity.Property(e => e.NonceStr).HasComment("随机字符串");
            entity.Property(e => e.NotifyUrl).HasComment("异步通知地址");
            entity.Property(e => e.OutTradeNo).HasComment("提现的商户订单号");
            entity.Property(e => e.PayAmount).HasComment("提现金额，单位为分");
            entity.Property(e => e.PayCurrency).HasComment("支付币种（默讣 CNY:人民币）");
            entity.Property(e => e.PayResult).HasComment("支付结果（00=成功，01=失败，03=处理中，04=延迟处理中）");
            entity.Property(e => e.PayState).HasComment("提现状态（00=成功，01=失败，03=处理中，04=延迟处理中）");
            entity.Property(e => e.PayTime).HasComment("提现完成时间");
            entity.Property(e => e.ProcedureCustomerCode).HasComment("手续费扣除商户");
            entity.Property(e => e.ProcedureFee).HasComment("手续费（单位分）");
            entity.Property(e => e.Protocol).HasComment("绑卡协议号");
            entity.Property(e => e.Remark).HasComment("备注");
            entity.Property(e => e.RequestData).HasComment("请求参数JSON");
            entity.Property(e => e.ServiceFee).HasComment("商户服务费（单位分，默认 0）");
            entity.Property(e => e.ServiceFeeState).HasComment("服务费收取状态（1：服务费收取成功，0或null：未收取服务费）");
            entity.Property(e => e.Summary).HasComment("摘要");
            entity.Property(e => e.TransactionNo).HasComment("易票联订单号");
            entity.Property(e => e.UserId).HasComment("用户ID");
            entity.Property(e => e.Version).HasComment("版本号（3.0）");
            entity.Property(e => e.WithdrawalAccountId).HasComment("提现账户ID");
            entity.Property(e => e.WithdrawalStatus)
                .HasDefaultValue(0)
                .HasComment("系统提现状态（0=处理中，1=成功，2=失败，3=延迟处理中）");
        });

        OnModelCreatingPartial(modelBuilder);
    }

    partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
